{include mobadmin.inc.header}
<!--tmpl-resource-->
<link href="/res/offer/mobadmin/css/common.css" rel="stylesheet" type="text/css" />
<link href="/res/offer/mobadmin/css/animate.css" rel="stylesheet" type="text/css" />
    <style>
        .baojiaList{ background:#fff;}
        .baojiaItem{ height: 1.826rem;line-height: 1.6rem;position: relative;color:#666;border-bottom: 1px solid #efefef;}
        .baojiaTxt{ margin-left:1.152rem;font-size:0.608rem; }
        .baojiaNub{ font-size:0.521rem;}
        .detailLink{ position: absolute;top:0rem;right: 0rem;padding-right:0.6rem;font-size:0.608rem;color:#2f8aff;line-height: 1.826rem;}
        .baojiaNub{ margin-left: 0.8rem;}
        .baojiaItem:before{
            position: absolute;
            top:0.7rem;left: 0.5rem;
            content:" ";
            width:0.4rem;height: 0.4rem;background: #666666;border-radius: 50%;
        }
        .detailTable{ width:100%;background: #fff;border-collapse: collapse; }
        .detailTable th{ border-bottom: 0.652rem solid #f2f2f2;font-size:0.608rem;color:#999999;height: 1.956rem;line-height: 1.956rem;}
        .detailTable td{ font-size:0.608rem;height: 1.826rem;line-height: 1rem;border-bottom: 1px solid #efefef; }
        .detailTable .firstTh{ padding-left: 0.5rem;}
        .detailTable .col1{ padding-left: 0.5rem;text-align: center;position: relative;}
        .detailTable .col3{ color:#3291ff;padding-left: 0.6rem; }
        .detailTable .col4{ color:#999;padding-left: 0.6rem; }
        .detailTable .danwei{ font-size:0.391rem; }
        .detailTable .col2{ padding-left: 0.5rem;}


        .baojiaInfo{ color:#999999;font-size:0.608rem;background: #fff;margin-top:0.63rem;padding:0rem 0rem; }
        .baojiaRow{ height: 1.8rem;line-height: 1.8rem;overflow: hidden;margin: 0rem 0.652rem;}
        .baojiaRowEdit{ border-bottom: 1px solid #efefef;}
        .baojiaRow .baojiaLeft{ float:left;width:1rem;position: relative;text-align: left;}
        .baojiaRow .baojiaLabel{}
        .modifyInp{ display: none;width:6rem;outline: none;padding: 0.3rem 0.2rem;
    -webkit-appearance: none; /*去除系统默认的样式*/
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* 点击高亮的颜色*/}
        .baojiaStar{ position: relative;color:#e34c59; }

        .addPhoneBtn,.delPhoneBtn{ width:0.869rem;height: 0.869rem;display: none;vertical-align: middle;}
        .baojiaRowEdit .addPhoneBtn,
        .baojiaRowEdit .delPhoneBtn{ display: inline-block;}
        .addPhoneBtn{ background: url("") no-repeat;background-size: 100%; }
        .delPhoneBtn{  background: url("") no-repeat;background-size: 100%;}
        /*.modifyBtn{ background: #5ba3ff;color:#fff;width:3.04rem;height: 1.304rem;line-height: 1.304rem; float: right;text-align: center;font-size:0.608rem; border-radius: 0.2rem;margin-right:0.6rem;}*/
        .detailTable .modifyInp{ width:2.2rem;text-align: center;}
        .modifyMode .col4{ padding-left:0rem;padding-right: 0.5rem; }
        .txt_view{
            margin-right: 0.652rem;
            float:right;
            color: #646464;
        }
        .txt_view em{
            font-style: normal;
            color: #2f8aff;
        }
        .shareSuccessPanel{ position: fixed;top:0px;left: 0px;right: 0px;bottom: 0px;background: url( /res/offer/mobadmin/images/shareSuccess.png) no-repeat;
            background-color: rgba(0,0,0,0.7);background-size: 100% auto;display: none;z-index: 2;
        }
        .baojiaIcon{ display: inline-block;width:0.782rem;height: 0.782rem;    vertical-align: middle;}
        .baojiaInfo .modifyInp{ border:none;padding: 0.5rem 0.2rem;width: 12rem;font-size:0.652rem; }
        .detailTable .radioBtn{ position:relative;vertical-align: middle;display: none;top:0rem;right:0rem;}
        .radioSel .radioCore{ display: block;}
        .modifyMode .radioBtn{ display: inline-block;}
        .modifyMode .pinmingCol{ border:1px solid #bbbbbb;border-radius: 0.2rem;padding:0.1rem;margin:0.2rem; }
        .pinmingColEdit{  }
        .modifyMode .bjNub{ display: none; }
        .delBtn{ display: none; }
         .braPanel{ position: fixed;top:0rem;left:0rem;width:100%;background: #fff; z-index:100;bottom:0rem;    -webkit-transform: translate3d(2000px, 0, 0); transform: translate3d(2000px, 0, 0);}
        .braContent{ margin:0rem 0.8rem;height:70%;overflow: scroll;position: relative;z-index: 100;background: #fff;}
        .grayBtn{  color: #b9b9b9;border-color: #b9b9b9;}
        .customRow{ text-align: center;height: 1.6rem;line-height: 1.6rem;    position: absolute;    width: 100%;bottom: 0.5rem;}
        .customRow .customLink{ color: #308bfe;font-size: 0.608rem; }
        .baojiaRow .baojiaLeft{ text-align: left;width:1rem; }
        .baojiaInfo{ padding:0rem; }
        .baojiaIcon{ display: inline-block;width:0.782rem;height: 0.782rem;    vertical-align: middle;}
       .braPanelBounceIn{     -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0); }


    </style>
<div class="shareSuccessPanel"></div>
<!--


      echo "{$item['auto_add_brand']['data_id']}";
      echo "{$item['auto_add_brand']['product_name']}";
      echo "{$item['auto_add_brand']['factory_name']}";
      echo "{$item['auto_add_brand']['brand_name']}";
      echo "{$item['auto_add_brand']['tpfb']}";
      echo "{$item['auto_add_brand']['type_name']}");

-->
    <div class="">
        <div class="commonTil">报价单<span class="txt_view">(被浏览<em>{$result[head]['views']}次</em>)</span></div>
        <div class="">
            <table class="detailTable bjtable">
                <thead>
                    <tr>
                        <th class="firstTh" width="15%">序号</th>
                        <th width="40%">品名/厂家/牌号</th>
                        <th width="25%">单价<span class="danwei">(元/吨)</span></th>
                        <th width="25%">数量<span class="danwei">(吨)</span></th>
                    </tr>
                </thead>
                <tbody>
                {if empty($result['items'])}
                <tr>
                    <td class="no-records text-center">{$noRecords}</td>
                </tr>
                {/if}
                {loop $result['items'] $k $value}
                <tr data-id="{$k+1}">

                    <td class="col1">
                        <span class="bjNub">{$k+1}</span>
                        <span class="radioBtn"><span class="radioCore"></span></span>
                    </td>
                    <td class="col2"><div class="pinmingCol" data-tpfb="{$value[tpfb]}" data-type="{$value[type_name]}"><span class="txt_pro">{$value[product_name]}</span>/<span class="txt_fac">{$value[factory_name]}</span>/<span class="txt_bra">{$value[brand_name]}</span></div></td>
                    <td class="col3"><span class="modifyTxt"><?php echo del0($value[sales_price])?></span><input type="text" data-act="sales_price" class="modifyInp tabNumberInp" value="<?php echo del0($value[sales_price])?>" oninput="focusNub(this)"/></td>
                    <td class="col4"><span class="modifyTxt"><?php echo del0($value[quantity])?></span><input type="text" data-act="quantity" class="modifyInp tabNumberInp" value="<?php echo del0($value[quantity])?>" oninput="focusNub(this)"/></td>

                </tr>

                {/loop}

                </tbody>
            </table>
        </div>
        <div class="blank30"></div>
        <div class=""><a href="javascript:delFun()" class="modifyBtn delBtn grayBtn">删除</a></div>
        <div class="blank10"></div>
        <form action="do_add" id="addOfferFrom">

        <div class="baojiaInfo">
            <input type="hidden" name="data[offer_products]">

            <div class="baojiaRow">
                <div class="baojiaLeft">

                    <span class="baojiaIcon bjDateIcon"></span>
                </div>
                <div class="baojiaRight">
                    <span ><?php echo date('Y/m/d H:i',strtotime($result[head]['addtime']))?></span>
                </div>
            </div>
            <div class="baojiaRow">
                <div class="baojiaLeft">
                    <span class="baojiaIcon bjContactIcon"></span>
                </div>
                <div class="baojiaRight">
                    <span class="modifyTxt">{$result[head]['contact']}</span>
                    <input type="text" name="data[contact]" class="modifyInp" value="{$result[head]['contact']}"/>
                </div>
            </div>
            <div class="baojiaRow">
                <div class="baojiaLeft">
                    <span class="baojiaIcon bjPhoneIcon"></span>
                </div>
                <div class="baojiaRight">
                    <span class="modifyTxt">{$result[head]['contact_mobile']}</span>
                    <input type="tel" name="data[contact_mobile]" class="modifyInp bluePhone phoneInp1" value="{$result[head]['contact_mobile']}" oninput="focusTel(this)" id="phoneInp1"/>
                    <span class="addPhoneBtn" id="addPhoneBtn"></span>
                    <span class="delPhoneBtn" id="delPhoneBtn" style="display:none;"></span>
                </div>
            </div>
            <?php if($result[head]['contact_mobile2']==''){ 
                $mobile2_style = "style='display:none;'";
            } ?>
            <div class="baojiaRow phoneRow2" {$mobile2_style}>
                <div class="baojiaLeft">
                    <span class="baojiaIcon bjPhone2Icon"></span>
                </div>
                <div class="baojiaRight">
                    <span class="modifyTxt">{$result[head]['contact_mobile2']}</span>
                    <input type="text" name="data[contact_mobile2]" class="modifyInp bluePhone " value="{$result[head]['contact_mobile2']}" oninput="focusTel(this)" style="display:none;" id="phoneInp2"/>
                    <span class="delPhoneBtn" id="delPhoneBtn2"></span>
                </div>
            </div>



            <?php if($result[head]['company_name']!=''){ ?>

            <div class="baojiaRow">
                <div class="baojiaLeft">
                    <span class="baojiaIcon bjCompanyIcon"></span>
                </div>
                <div class="baojiaRight">
                    <span class="modifyTxt">{$result[head]['company_name']}</span>
                    <input type="text" name="data[company_name]" class="modifyInp" value="{$result[head]['company_name']}"/>
                </div>
            </div>
            <?php } ?>
            <?php if($result[head]['delivery_place']!=''){ ?>

               <div class="baojiaRow">
                   <div class="baojiaLeft">
                       <span class="baojiaIcon bjAddrIcon"></span>
                   </div>
                   <div class="baojiaRight">
                       <span class="modifyTxt">{$result[head]['delivery_place']}</span>
                       <input type="text" name="data[delivery_place]" class="modifyInp" value="{$result[head]['delivery_place']}"/>
                   </div>
               </div>
            <?php } ?>

        </div>
        <div class="blank30"></div>
        <div class="">
            <a href="javascript:modifyFun()" class="modifyBtn">修改</a>
            <a href="javascript:void(0)" data-act="do_add" class="modifyBtn saveBtn" style="display:none;">保存</a>

        </div>
</form>

        <div class="blank30"></div>
        <div class="blank30"></div>
        <div class="botBtn">
            <a href="/mobadmin/offer/add">新增报价</a>
        </div>
    </div>

<div class="braPanel tpfb_panel animated" >
    <a href="#" class="panelClose"></a>
    <div class="blank30"></div><div class="blank30"></div>
    <div class="blank30"></div>
    <div class="searchRow">
        <input class="serchInp" />
        <a href="#" class="searchBtn">搜索</a>
        <div class="searchPop">
            <span class="searchIcon"></span> <span class="searchPsTxt">请输入您需要搜索的牌号</span>
        </div>
    </div>
    <div class="blank30"></div>

    <div class="braContent">

    </div>
    <div class="blank30"></div>
    <div class="blank30"></div>
    <!--<div class="confirmBtn">
        <a href="#" class="cd_cancel">取消</a>
        <a href="#" class="cf_yes">确定</a>
    </div>-->
    <div class="zimuNav">
        <a href="javascript:void(0)">A</a>
        <a href="javascript:void(0)">B</a>
        <a href="javascript:void(0)">C</a>
        <a href="javascript:void(0)">D</a>
        <a href="javascript:void(0)">E</a>
        <a href="javascript:void(0)">F</a>
        <a href="javascript:void(0)">G</a>
        <a href="javascript:void(0)">H</a>
        <a href="javascript:void(0)">I</a>
        <a href="javascript:void(0)">J</a>
        <a href="javascript:void(0)">K</a>
        <a href="javascript:void(0)">L</a>
        <a href="javascript:void(0)">M</a>
        <a href="javascript:void(0)">N</a>
        <a href="javascript:void(0)">O</a>
        <a href="javascript:void(0)">P</a>
        <a href="javascript:void(0)">Q</a>
        <a href="javascript:void(0)">R</a>
        <a href="javascript:void(0)">S</a>
        <a href="javascript:void(0)">T</a>
        <a href="javascript:void(0)">U</a>
        <a href="javascript:void(0)">V</a>
        <a href="javascript:void(0)">W</a>
        <a href="javascript:void(0)">X</a>
        <a href="javascript:void(0)">Y</a>
        <a href="javascript:void(0)">Z</a>
    </div>
    <div class="zimuTishi ">A</div>
    <div class="blank30"></div><div class="blank10"></div>
    <div class="customRow"><a class="customLink" href="/mobadmin/brand/add">没有牌号？请自定义牌号</a></div>
</div>

    <script type="text/javascript">
        function focusTel(me){
            var val = $(me).val().toString();
            $(me).val(val.replace(/[^\d\-]+/g,"").substring(0,18));
        }
        function focusNub(me){
            var val = $(me).val().toString();
            //if(val.length != val.replace(/[^\d\.]+/g,"").substring(0,8).length){
                $(me).val(val.replace(/[^\d\.]+/g,"").substring(0,8));
            //}
        }

        $(".shareSuccessPanel").click(function(){
            $(".shareSuccessPanel").hide();
        });
    </script>

<?php if($shareSuccessPanel=='1'){ ?>
  <script type="text/javascript">

      $(".shareSuccessPanel").show();


  </script>

<?php } ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="/res/offer/js/jweixin-min.js"></script>

<!--footer section start-->
{include mobadmin.inc.footer}
<!--footer section end-->

<script type="text/javascript">
    var offer_id = "{$offer_id}";
    seajs.use("offer_detail",function (exports){
        exports.init("{$item['auto_add_brand']['data_id']}","{$item['auto_add_brand']['product_name']}",
                    "{$item['auto_add_brand']['factory_name']}","{$item['auto_add_brand']['brand_name']}","{$item['auto_add_brand']['tpfb']}","{$item['auto_add_brand']['type_name']}");
        // 注册微信分享接口
        weiXin({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: '{$token.appId}', // 必填，公众号的唯一标识
            timestamp: "{$token.timestamp}", // 必填，生成签名的时间戳
            nonceStr: '{$token.nonceStr}', // 必填，生成签名的随机串
            signature: '{$token.signature}',// 必填，签名，见附录1
            title: "好料、有料，你想要的都在这里！来自{$result[head]['contact']}的报价分享：", // 分享标题
            desc: "{$first_offer_decs}", // 分享描述
            link: '{$token.url}', // 分享链接
            imgUrl: window.location.origin+"/res/offer/img/wx_share.jpg" // 分享图标
        });
    });

    $("#addPhoneBtn").click(function(){
        $(".phoneRow2").show();
        $("#addPhoneBtn").hide();
        $("#delPhoneBtn").show();
    });
    $("#delPhoneBtn").click(function(){
        $("#phoneInp1").val($("#phoneInp2").val());
        $("#phoneInp2").val("");
        $("#addPhoneBtn").show();
        $("#delPhoneBtn").hide();
        $(".phoneRow2").hide();

    });
    $("#delPhoneBtn2").click(function(){

        $("#phoneInp2").val("");
        $("#addPhoneBtn").show();
        $("#delPhoneBtn").hide();
        $(".phoneRow2").hide();
    });

</script>

